package sk.vrto.domain;

/**
 * Encapsulates contact and flag, whether it was freshly created.
 */
public class ContactCreation {

    private final Contact contact;
    private boolean freshlyCreated;

    /**
     * @param contact Obtained contact
     * @param freshlyCreated Flag, whether this contact was freshly created
     *                       or alredy existing one.
     */
    public ContactCreation(Contact contact, boolean freshlyCreated) {
        this.contact = contact;
        this.freshlyCreated = freshlyCreated;
    }

    public Contact getContact() {
        return contact;
    }

    public boolean isFreshlyCreated() {
        return freshlyCreated;
    }

    @Override
    public String toString() {
        return "ContactCreation{" +
                "contact=" + contact +
                ", freshlyCreated=" + freshlyCreated +
                '}';
    }
}
